package testing;

import org.junit.*;
import static org.junit.Assert.*;

import poker.Card;
import poker.Deck;
import poker.HandStrength;

public class TestHandStrength 
{
	@Test
	public void TestAgainstCertainWin()
	{
		Card[] communityCards = { new Card('s',14 ), new Card('s', 2), new Card('s', 3) };

		Card[] hand = {new Card('s', 4), new Card('s', 5)};	
		double strength = HandStrength.calculateHandStrength(hand, communityCards, 10);
		System.out.println("Should be: 1, is: " + strength);
	
		Card[] hand2 = {new Card('d', 14), new Card('h', 14)};
		double strength2 = HandStrength.calculateHandStrength(hand2, communityCards, 2);
		System.out.println("Should be: 0.944, is: " + strength2);
	
		Card[] hand3 = {new Card('h', 4), new Card('h', 5)};
		double strength3 = HandStrength.calculateHandStrength(hand3, communityCards, 2);
		System.out.println("Should be: 0.955, is: " + strength3);
	
		Card[] hand4 = {new Card('d', 14), new Card('h', 3)};
		double strength4 = HandStrength.calculateHandStrength(hand4, communityCards, 2);
		System.out.println("Should be: 0.938, is: " + strength4);
		
		Card[] hand5 = {new Card('d', 4), new Card('d', 9)};
		double strength5 = HandStrength.calculateHandStrength(hand5, communityCards, 2);
		System.out.println("Should be: 0.028, is: " + strength5);
	}
	
	@Test
	public void TestAgainstOneTurn()
	{
		Card[] communityCards = { new Card('s',14 ), new Card('s', 2), new Card('s', 3), new Card('c', 14) };

		Card[] hand = {new Card('s', 4), new Card('s', 5)};	
		double strength = HandStrength.calculateHandStrength(hand, communityCards, 10);
		System.out.println("Should be: 1, is: " + strength);
	
		Card[] hand2 = {new Card('d', 14), new Card('h', 14)};
		double strength2 = HandStrength.calculateHandStrength(hand2, communityCards, 2);
		System.out.println("Should be: 0.999, is: " + strength2);
	
		Card[] hand3 = {new Card('h', 4), new Card('h', 5)};
		double strength3 = HandStrength.calculateHandStrength(hand3, communityCards, 2);
		System.out.println("Should be: 0.934, is: " + strength3);
	
		Card[] hand4 = {new Card('d', 14), new Card('h', 3)};
		double strength4 = HandStrength.calculateHandStrength(hand4, communityCards, 2);
		System.out.println("Should be: 0.998, is: " + strength4);
		
		Card[] hand5 = {new Card('d', 4), new Card('d', 9)};
		double strength5 = HandStrength.calculateHandStrength(hand5, communityCards, 2);
		System.out.println("Should be: 0.123, is: " + strength5);
	}
}